<template>
  <div class="app-container">

    <el-table v-loading="loading" :data="logList" >
      <el-table-column label="日志id" align="center" prop="id" />
      <el-table-column label="大棚名称" align="center" prop="groupName" />
      <el-table-column label="设备名称" align="center" prop="deviceName" />
      <el-table-column label="属性名称" align="center" prop="attributeName" />
      <el-table-column label="报警名称" align="center" prop="alarmName" />
      <el-table-column label="属性值" align="center" prop="value" />
 
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { listLog, getLog, delLog, addLog, updateLog, exportLog } from "@/api/business/alarm/alarmlog";

export default {
  name: "AlarmLog",
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 报警日志表格数据
      logList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        alarmName: null,
        groupName: null,
        attributeName: null,
        value: null,
        deviceId: null,
        deviceName: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询报警日志列表 */
    getList() {
      this.loading = true;
      listLog(this.queryParams).then(response => {
        this.logList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        alarmId: null,
        alarmName: null,
        groupId: null,
        attributeId: null,
        groupName: null,
        attributeName: null,
        value: null,
        deviceId: null,
        deviceName: null
      };
      this.resetForm("form");
    },





  }
};
</script>
